using System;
using System.Drawing;
using System.Windows.Forms;
using FarPoint.Win.Spread.DrawingSpace;
using FarPoint.Win;
using FarPoint.Win.Spread;

namespace Spread.FloatingObjects.Features
{
    public partial class ImagesAndShapes : Spread.Common.Features.Sample.BaseSampleControl
    {
        private const int WIDTH = 100;
        private const int HEIGHT = 60;

        public ImagesAndShapes()
        {
            InitializeComponent();
            Name = "Images and Shapes";

            InitControls();
            InitSpreadSheet(fpSpread.ActiveSheet);

            shapePanel1.ShapeSelected += ShapePanel1_ShapeSelected;

            fpSpread.ShapeDeactivated += FpSpread_ShapeDeactivated;
            fpSpread.ShapeActivated += FpSpread_ShapeActivated;
        }

        #region Private methods
        private void InitSpreadSheet(SheetView sheet)
        {
            sheet.SetMultipleRowHeights(0, fpSpread.ActiveSheet.RowCount, 20);

            RectangleShape shape1 = new RectangleShape();
            shape1.Size = new Size(WIDTH, HEIGHT);
            shape1.BackgroundImage = new Picture(Image.FromFile("Resources\\splogo.png"));
            shape1.BackgroundImage.Style = RenderStyle.StretchAndScale;

            RectangleShape shape2 = new RectangleShape();
            shape2.Size = new Size(WIDTH, HEIGHT);

            sheet.AddShape(shape1, 3, 2);
            sheet.AddShape(shape2, 3, 6);
        }

        private void InitControls()
        {
            Controls.Add(shapePanel1);
            shapePanel1.BringToFront();

            comboOutlineStyle.DataSource = Enum.GetValues(typeof(System.Drawing.Drawing2D.DashStyle));
            comboDropShadow.DataSource = Enum.GetValues(typeof(ShadowDirection));

            btnPicture.Click += BtnPicture_Click;
            btnShape.Click += BtnShape_Click;

            btnBackColor.Click += BtnBackColor_Click;
            btnForeColor.Click += BtnForeColor_Click;
            btnOutlineColor.Click += BtnOutlineColor_Click;

            btnSetPicture.Click += BtnSetPicture_Click;
            btnBringToFront.Click += BtnBringToFront_Click;
            btnSendToBack.Click += BtnSendToBack_Click;

            numericRotate.ValueChanged += NumericRotate_ValueChanged;
            numericScale.ValueChanged += NumericScale_ValueChanged;
        }

        private void ShowColorPicker(Button button)
        {
            ColorDialog dialog = new ColorDialog();
            dialog.Color = button.BackColor;

            if (dialog.ShowDialog() == DialogResult.OK)
                button.BackColor = dialog.Color;
        }

        private void ToggleShapeControls(bool enable)
        {
            btnBackColor.Enabled = enable;
            btnForeColor.Enabled = enable;
            btnOutlineColor.Enabled = enable;
            numericThickness.Enabled = enable;
            comboOutlineStyle.Enabled = enable;
            comboDropShadow.Enabled = enable;
            btnBringToFront.Enabled = enable;
            btnSendToBack.Enabled = enable;
            btnSetPicture.Enabled = enable;

            chkRotate.Enabled = enable;
            chkHorizontalFlip.Enabled = enable;
            chkVerticalFlip.Enabled = enable;
            chkScale.Enabled = enable;

            if (!enable)
            {
                numericRotate.Enabled = false;
                numericScale.Enabled = false;
            }
            else
            {
                numericRotate.Enabled = chkRotate.Checked;
                numericScale.Enabled = chkScale.Checked;
            }
        }

        private Image GetImageUsingFileDialog()
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.CheckFileExists = true;
            dialog.CheckPathExists = true;
            dialog.Multiselect = false;
            dialog.Filter = "Images|*.jpeg;*.jpg;*.png;*.bmp";

            Image image = null;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    image = Image.FromFile(dialog.FileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error loading image", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            return image;
        }

        private void ScaleShape(PSShape shape, float scaleFactor)
        {
            fpSpread.SuspendLayout();
            float scaleX = scaleFactor * ((float)WIDTH / shape.Width);
            float scaleY = scaleFactor * ((float)HEIGHT / shape.Height);
            shape.Scale(scaleX, scaleY, true);
            fpSpread.ResumeLayout(true);
        }

        private void RotateShape(PSShape shape, int angle)
        {
            Point center = new Point(shape.Left + shape.Width / 2, shape.Top + shape.Height / 2);
            shape.Rotate(center, -shape.RotationAngle);
            if (chkRotate.Checked)
                shape.Rotate(center, angle);
        }
        #endregion

        #region Event handlers
        private void FpSpread_ShapeActivated(object sender, EventArgs e)
        {
            var shape = fpSpread.ActiveWindowlessObject as PSShape;

            btnBackColor.BackColor = shape.BackColor;
            btnForeColor.BackColor = shape.ForeColor;
            btnOutlineColor.BackColor = shape.ShapeOutlineColor;
            numericThickness.Value = (decimal)shape.ShapeOutlineThickness;
            comboOutlineStyle.SelectedItem = shape.ShapeOutlineStyle;
            comboDropShadow.SelectedItem = shape.ShadowDirection;
            chkHorizontalFlip.Checked = shape.FlipHorizontal;
            chkVerticalFlip.Checked = shape.FlipVertical;
            numericRotate.Value = (decimal)shape.RotationAngle;
            chkRotate.Checked = numericRotate.Value != 0;
            chkScale.Checked = false;

            ToggleShapeControls(true);

            comboOutlineStyle.SelectedIndexChanged += ComboOutlineStyle_SelectedIndexChanged;
            comboDropShadow.SelectedIndexChanged += ComboDropShadow_SelectedIndexChanged;
            numericThickness.ValueChanged += NumericThickness_ValueChanged;
            btnBackColor.BackColorChanged += BtnBackColor_BackColorChanged;
            btnForeColor.BackColorChanged += BtnForeColor_BackColorChanged;
            btnOutlineColor.BackColorChanged += BtnOutlineColor_BackColorChanged;

            chkRotate.CheckedChanged += ChkRotate_CheckedChanged;
            chkHorizontalFlip.CheckedChanged += ChkHorizontalFlip_CheckedChanged;
            chkVerticalFlip.CheckedChanged += ChkVerticalFlip_CheckedChanged;
            chkScale.CheckedChanged += ChkScale_CheckedChanged;
        }

        private void FpSpread_ShapeDeactivated(object sender, EventArgs e)
        {
            ToggleShapeControls(false);

            comboOutlineStyle.SelectedIndexChanged -= ComboOutlineStyle_SelectedIndexChanged;
            comboDropShadow.SelectedIndexChanged -= ComboDropShadow_SelectedIndexChanged;
            numericThickness.ValueChanged -= NumericThickness_ValueChanged;
            btnBackColor.BackColorChanged -= BtnBackColor_BackColorChanged;
            btnForeColor.BackColorChanged -= BtnForeColor_BackColorChanged;
            btnOutlineColor.BackColorChanged -= BtnOutlineColor_BackColorChanged;

            chkHorizontalFlip.CheckedChanged -= ChkHorizontalFlip_CheckedChanged;
            chkVerticalFlip.CheckedChanged -= ChkVerticalFlip_CheckedChanged;
            chkRotate.CheckedChanged -= ChkRotate_CheckedChanged;
            chkScale.CheckedChanged -= ChkScale_CheckedChanged;

            chkRotate.Checked = false;
            numericRotate.Value = 0;
            chkScale.Checked = false;
            numericScale.Value = 100;
        }

        private void ShapePanel1_ShapeSelected(object sender, ShapeSelectedEventArgs e)
        {
            PSShape shape  = Spread.FloatingObjects.Features.ShapeActions.CreateShapeInstance(e.ShapeName);
            shape.Size = new Size(WIDTH, HEIGHT);
            fpSpread.ActiveSheet.AddShape(shape, fpSpread.ActiveSheet.ActiveRowIndex, fpSpread.ActiveSheet.ActiveColumnIndex);
        }

        #region CheckBox events
        private void ChkVerticalFlip_CheckedChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).FlipVertical = chkVerticalFlip.Checked;
        }

        private void ChkHorizontalFlip_CheckedChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).FlipHorizontal = chkHorizontalFlip.Checked;
        }

        private void ChkRotate_CheckedChanged(object sender, EventArgs e)
        {
            numericRotate.Enabled = chkRotate.Checked;
            PSShape shape = fpSpread.ActiveWindowlessObject as PSShape;
            RotateShape(shape, (int)numericRotate.Value);
        }

        private void ChkScale_CheckedChanged(object sender, EventArgs e)
        {
            numericScale.Enabled = chkScale.Checked;
            PSShape shape = fpSpread.ActiveWindowlessObject as PSShape;

            if (chkScale.Checked)
            {
                ScaleShape(shape, (float)numericScale.Value / 100);
            }
            else
                shape.Size = new Size(WIDTH, HEIGHT);
        }
        #endregion

        #region Button events
        private void BtnShape_Click(object sender, EventArgs e)
        {
            Point screenPoint = groupBox1.PointToScreen(new Point(btnShape.Right, btnShape.Bottom + 3));
            shapePanel1.Location = PointToClient(new Point(screenPoint.X - shapePanel1.Width, screenPoint.Y));
            shapePanel1.Visible = true;
            shapePanel1.BringToFront();
        }

        private void BtnPicture_Click(object sender, EventArgs e)
        {
            Image image = GetImageUsingFileDialog();
            if (image == null)
                return;

            RectangleShape shape = new RectangleShape();
            shape.BackgroundImage = new Picture(image);
            shape.BackgroundImage.Style = RenderStyle.Normal;
            Rectangle rect = fpSpread.GetCellRectangle(0, 0, fpSpread.ActiveSheet.ActiveRowIndex,
                fpSpread.ActiveSheet.ActiveColumnIndex);
            shape.Location = rect.Location;
            shape.Size = image.Size;
            fpSpread.ActiveSheet.DrawingContainer.ContainedObjects.Add(shape);
        }

        private void BtnBackColor_Click(object sender, EventArgs e)
        {
            ShowColorPicker(sender as Button);
        }

        private void BtnForeColor_Click(object sender, EventArgs e)
        {
            ShowColorPicker(sender as Button);
        }

        private void BtnOutlineColor_Click(object sender, EventArgs e)
        {
            ShowColorPicker(sender as Button);
        }

        private void BtnSetPicture_Click(object sender, EventArgs e)
        {
            Image image = GetImageUsingFileDialog();
            if (image == null)
                return;

            (fpSpread.ActiveWindowlessObject as PSShape).Picture = image;
        }

        private void BtnSendToBack_Click(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).SendToBack(fpSpread.ActiveWindowlessObject);
        }

        private void BtnBringToFront_Click(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).BringToFront(fpSpread.ActiveWindowlessObject);
        }

        private void BtnOutlineColor_BackColorChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).ShapeOutlineColor = btnOutlineColor.BackColor;
        }

        private void BtnForeColor_BackColorChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).BackColor = btnForeColor.BackColor;
        }

        private void BtnBackColor_BackColorChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).BackColor = btnBackColor.BackColor;
        }
        #endregion

        #region ComboBox events
        private void ComboDropShadow_SelectedIndexChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).ShadowDirection = (ShadowDirection)comboDropShadow.SelectedItem;
        }

        private void ComboOutlineStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).ShapeOutlineStyle = (System.Drawing.Drawing2D.DashStyle)
                comboOutlineStyle.SelectedItem;
        }
        #endregion

        #region NumericTextBox Events
        private void NumericThickness_ValueChanged(object sender, EventArgs e)
        {
            (fpSpread.ActiveWindowlessObject as PSShape).ShapeOutlineThickness = (float)numericThickness.Value;
        }

        private void NumericScale_ValueChanged(object sender, EventArgs e)
        {
            PSShape shape = fpSpread.ActiveWindowlessObject as PSShape;
            if (shape == null)
                return;
            ScaleShape(shape, (float)numericScale.Value / 100);
        }

        private void NumericRotate_ValueChanged(object sender, EventArgs e)
        {
            PSShape shape = fpSpread.ActiveWindowlessObject as PSShape;
            if (shape == null)
                return;
            Point center = new Point(shape.Left + shape.Width / 2, shape.Top + shape.Height / 2);
            fpSpread.SuspendLayout();
            shape.Rotate(center, -shape.RotationAngle);
            shape.Rotate(center, (float)numericRotate.Value);
            fpSpread.ResumeLayout(false);
        }
        #endregion

        #endregion 
    }
}


//
//ImagesAndShapes.Designer.cs
//


namespace Spread.FloatingObjects.Features
{
    partial class ImagesAndShapes
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImagesAndShapes));
            this.fpSpread = new FarPoint.Win.Spread.FpSpread();
            this.fpSpread_Sheet1 = new FarPoint.Win.Spread.SheetView();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.btnShape = new System.Windows.Forms.Button();
            this.btnPicture = new System.Windows.Forms.Button();
            this.shapePanel1 = new Spread.FloatingObjects.ShapePanel();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.btnSetPicture = new System.Windows.Forms.Button();
            this.comboDropShadow = new System.Windows.Forms.ComboBox();
            this.comboOutlineStyle = new System.Windows.Forms.ComboBox();
            this.numericThickness = new System.Windows.Forms.NumericUpDown();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.btnOutlineColor = new System.Windows.Forms.Button();
            this.btnForeColor = new System.Windows.Forms.Button();
            this.btnBackColor = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.numericScale = new System.Windows.Forms.NumericUpDown();
            this.numericRotate = new System.Windows.Forms.NumericUpDown();
            this.chkScale = new System.Windows.Forms.CheckBox();
            this.chkRotate = new System.Windows.Forms.CheckBox();
            this.chkVerticalFlip = new System.Windows.Forms.CheckBox();
            this.chkHorizontalFlip = new System.Windows.Forms.CheckBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.btnBringToFront = new System.Windows.Forms.Button();
            this.btnSendToBack = new System.Windows.Forms.Button();
            this.pnlMain.SuspendLayout();
            this.pnlControls.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread_Sheet1)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericThickness)).BeginInit();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericScale)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericRotate)).BeginInit();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // pnlMain
            // 
            this.pnlMain.Controls.Add(this.fpSpread);
            this.pnlMain.Size = new System.Drawing.Size(477, 538);
            // 
            // pnlControls
            // 
            this.pnlControls.AutoScroll = true;
            this.pnlControls.Controls.Add(this.groupBox3);
            this.pnlControls.Controls.Add(this.groupBox2);
            this.pnlControls.Controls.Add(this.groupBox1);
            this.pnlControls.Size = new System.Drawing.Size(157, 538);
            // 
            // fpSpread
            // 
            this.fpSpread.Dock = System.Windows.Forms.DockStyle.Fill;
            this.fpSpread.Location = new System.Drawing.Point(0, 0);
            this.fpSpread.Name = "fpSpread";
            this.fpSpread.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
            this.fpSpread_Sheet1});
            this.fpSpread.Size = new System.Drawing.Size(477, 538);
            this.fpSpread.StatusBarVisible = true;
            this.fpSpread.TabIndex = 0;
            // 
            // fpSpread_Sheet1
            // 
            this.fpSpread_Sheet1.Reset();
            this.fpSpread_Sheet1.SheetName = "Sheet1";
            // Formulas and custom names must be loaded with R1C1 reference style
            this.fpSpread_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
            this.fpSpread_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.btnShape);
            this.groupBox1.Controls.Add(this.btnPicture);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(157, 88);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Insert Shape/Image";
            // 
            // btnShape
            // 
            this.btnShape.Image = ((System.Drawing.Image)(resources.GetObject("btnShape.Image")));
            this.btnShape.Location = new System.Drawing.Point(71, 19);
            this.btnShape.Name = "btnShape";
            this.btnShape.Size = new System.Drawing.Size(53, 59);
            this.btnShape.TabIndex = 1;
            this.btnShape.Text = "Shape";
            this.btnShape.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.btnShape.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnShape.UseVisualStyleBackColor = false;
            // 
            // btnPicture
            // 
            this.btnPicture.Image = ((System.Drawing.Image)(resources.GetObject("btnPicture.Image")));
            this.btnPicture.Location = new System.Drawing.Point(6, 19);
            this.btnPicture.Name = "btnPicture";
            this.btnPicture.Size = new System.Drawing.Size(57, 59);
            this.btnPicture.TabIndex = 0;
            this.btnPicture.Text = "Picture";
            this.btnPicture.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.btnPicture.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnPicture.UseVisualStyleBackColor = false;
            // 
            // shapePanel1
            // 
            this.shapePanel1.Location = new System.Drawing.Point(-86, 84);
            this.shapePanel1.Name = "shapePanel1";
            this.shapePanel1.Size = new System.Drawing.Size(210, 180);
            this.shapePanel1.TabIndex = 2;
            this.shapePanel1.Visible = false;
            // 
            // groupBox2
            // 
            this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox2.Controls.Add(this.btnSetPicture);
            this.groupBox2.Controls.Add(this.comboDropShadow);
            this.groupBox2.Controls.Add(this.comboOutlineStyle);
            this.groupBox2.Controls.Add(this.numericThickness);
            this.groupBox2.Controls.Add(this.label6);
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this.btnOutlineColor);
            this.groupBox2.Controls.Add(this.btnForeColor);
            this.groupBox2.Controls.Add(this.btnBackColor);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Controls.Add(this.label1);
            this.groupBox2.Location = new System.Drawing.Point(0, 91);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(157, 271);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Shape Style";
            // 
            // btnSetPicture
            // 
            this.btnSetPicture.Enabled = false;
            this.btnSetPicture.Image = ((System.Drawing.Image)(resources.GetObject("btnSetPicture.Image")));
            this.btnSetPicture.Location = new System.Drawing.Point(9, 201);
            this.btnSetPicture.Name = "btnSetPicture";
            this.btnSetPicture.Size = new System.Drawing.Size(69, 59);
            this.btnSetPicture.TabIndex = 8;
            this.btnSetPicture.Text = "Set Picture";
            this.btnSetPicture.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.btnSetPicture.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnSetPicture.UseVisualStyleBackColor = false;
            // 
            // comboDropShadow
            // 
            this.comboDropShadow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.comboDropShadow.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboDropShadow.Enabled = false;
            this.comboDropShadow.FormattingEnabled = true;
            this.comboDropShadow.Location = new System.Drawing.Point(84, 167);
            this.comboDropShadow.Name = "comboDropShadow";
            this.comboDropShadow.Size = new System.Drawing.Size(67, 21);
            this.comboDropShadow.TabIndex = 7;
            // 
            // comboOutlineStyle
            // 
            this.comboOutlineStyle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.comboOutlineStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboOutlineStyle.Enabled = false;
            this.comboOutlineStyle.FormattingEnabled = true;
            this.comboOutlineStyle.Location = new System.Drawing.Point(84, 137);
            this.comboOutlineStyle.Name = "comboOutlineStyle";
            this.comboOutlineStyle.Size = new System.Drawing.Size(67, 21);
            this.comboOutlineStyle.TabIndex = 6;
            // 
            // numericThickness
            // 
            this.numericThickness.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.numericThickness.Enabled = false;
            this.numericThickness.Location = new System.Drawing.Point(84, 109);
            this.numericThickness.Name = "numericThickness";
            this.numericThickness.Size = new System.Drawing.Size(67, 20);
            this.numericThickness.TabIndex = 5;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(6, 170);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(72, 13);
            this.label6.TabIndex = 4;
            this.label6.Text = "DropShadow:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(6, 140);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(69, 13);
            this.label5.TabIndex = 3;
            this.label5.Text = "Outline Style:";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(6, 111);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(59, 13);
            this.label4.TabIndex = 2;
            this.label4.Text = "Thickness:";
            // 
            // btnOutlineColor
            // 
            this.btnOutlineColor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.btnOutlineColor.Enabled = false;
            this.btnOutlineColor.Location = new System.Drawing.Point(84, 77);
            this.btnOutlineColor.Name = "btnOutlineColor";
            this.btnOutlineColor.Size = new System.Drawing.Size(67, 23);
            this.btnOutlineColor.TabIndex = 1;
            this.btnOutlineColor.UseVisualStyleBackColor = true;
            // 
            // btnForeColor
            // 
            this.btnForeColor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.btnForeColor.Enabled = false;
            this.btnForeColor.Location = new System.Drawing.Point(84, 50);
            this.btnForeColor.Name = "btnForeColor";
            this.btnForeColor.Size = new System.Drawing.Size(67, 23);
            this.btnForeColor.TabIndex = 1;
            this.btnForeColor.UseVisualStyleBackColor = true;
            // 
            // btnBackColor
            // 
            this.btnBackColor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.btnBackColor.Enabled = false;
            this.btnBackColor.Location = new System.Drawing.Point(84, 22);
            this.btnBackColor.Name = "btnBackColor";
            this.btnBackColor.Size = new System.Drawing.Size(67, 23);
            this.btnBackColor.TabIndex = 1;
            this.btnBackColor.UseVisualStyleBackColor = true;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(5, 82);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(70, 13);
            this.label3.TabIndex = 0;
            this.label3.Text = "Outline Color:";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(5, 55);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(58, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "Fore Color:";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(6, 27);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(62, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Back Color:";
            // 
            // groupBox3
            // 
            this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox3.Controls.Add(this.numericScale);
            this.groupBox3.Controls.Add(this.numericRotate);
            this.groupBox3.Controls.Add(this.chkScale);
            this.groupBox3.Controls.Add(this.chkRotate);
            this.groupBox3.Controls.Add(this.chkVerticalFlip);
            this.groupBox3.Controls.Add(this.chkHorizontalFlip);
            this.groupBox3.Controls.Add(this.tableLayoutPanel1);
            this.groupBox3.Location = new System.Drawing.Point(2, 364);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(152, 161);
            this.groupBox3.TabIndex = 2;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Shape Arrange";
            // 
            // numericScale
            // 
            this.numericScale.Enabled = false;
            this.numericScale.Location = new System.Drawing.Point(69, 128);
            this.numericScale.Maximum = new decimal(new int[] {
            2000,
            0,
            0,
            0});
            this.numericScale.Name = "numericScale";
            this.numericScale.Size = new System.Drawing.Size(83, 20);
            this.numericScale.TabIndex = 7;
            this.numericScale.Value = new decimal(new int[] {
            100,
            0,
            0,
            0});
            // 
            // numericRotate
            // 
            this.numericRotate.Enabled = false;
            this.numericRotate.Location = new System.Drawing.Point(69, 99);
            this.numericRotate.Maximum = new decimal(new int[] {
            360,
            0,
            0,
            0});
            this.numericRotate.Minimum = new decimal(new int[] {
            360,
            0,
            0,
            -2147483648});
            this.numericRotate.Name = "numericRotate";
            this.numericRotate.Size = new System.Drawing.Size(83, 20);
            this.numericRotate.TabIndex = 6;
            // 
            // chkScale
            // 
            this.chkScale.AutoSize = true;
            this.chkScale.Enabled = false;
            this.chkScale.Location = new System.Drawing.Point(6, 129);
            this.chkScale.Name = "chkScale";
            this.chkScale.Size = new System.Drawing.Size(53, 17);
            this.chkScale.TabIndex = 5;
            this.chkScale.Text = "Scale";
            this.chkScale.UseVisualStyleBackColor = true;
            // 
            // chkRotate
            // 
            this.chkRotate.AutoSize = true;
            this.chkRotate.Enabled = false;
            this.chkRotate.Location = new System.Drawing.Point(6, 100);
            this.chkRotate.Name = "chkRotate";
            this.chkRotate.Size = new System.Drawing.Size(58, 17);
            this.chkRotate.TabIndex = 5;
            this.chkRotate.Text = "Rotate";
            this.chkRotate.UseVisualStyleBackColor = true;
            // 
            // chkVerticalFlip
            // 
            this.chkVerticalFlip.AutoSize = true;
            this.chkVerticalFlip.Enabled = false;
            this.chkVerticalFlip.Location = new System.Drawing.Point(6, 77);
            this.chkVerticalFlip.Name = "chkVerticalFlip";
            this.chkVerticalFlip.Size = new System.Drawing.Size(80, 17);
            this.chkVerticalFlip.TabIndex = 4;
            this.chkVerticalFlip.Text = "Vertical Flip";
            this.chkVerticalFlip.UseVisualStyleBackColor = true;
            // 
            // chkHorizontalFlip
            // 
            this.chkHorizontalFlip.AutoSize = true;
            this.chkHorizontalFlip.Enabled = false;
            this.chkHorizontalFlip.Location = new System.Drawing.Point(6, 58);
            this.chkHorizontalFlip.Name = "chkHorizontalFlip";
            this.chkHorizontalFlip.Size = new System.Drawing.Size(92, 17);
            this.chkHorizontalFlip.TabIndex = 3;
            this.chkHorizontalFlip.Text = "Horizontal Flip";
            this.chkHorizontalFlip.UseVisualStyleBackColor = true;
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Controls.Add(this.btnBringToFront, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.btnSendToBack, 1, 0);
            this.tableLayoutPanel1.Location = new System.Drawing.Point(1, 19);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 1;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(151, 27);
            this.tableLayoutPanel1.TabIndex = 0;
            // 
            // btnBringToFront
            // 
            this.btnBringToFront.AutoSize = true;
            this.btnBringToFront.Dock = System.Windows.Forms.DockStyle.Fill;
            this.btnBringToFront.Enabled = false;
            this.btnBringToFront.Location = new System.Drawing.Point(3, 3);
            this.btnBringToFront.Name = "btnBringToFront";
            this.btnBringToFront.Size = new System.Drawing.Size(69, 21);
            this.btnBringToFront.TabIndex = 0;
            this.btnBringToFront.Text = "Bring To Front";
            this.btnBringToFront.UseVisualStyleBackColor = true;
            // 
            // btnSendToBack
            // 
            this.btnSendToBack.AutoSize = true;
            this.btnSendToBack.Dock = System.Windows.Forms.DockStyle.Fill;
            this.btnSendToBack.Enabled = false;
            this.btnSendToBack.Location = new System.Drawing.Point(78, 3);
            this.btnSendToBack.Name = "btnSendToBack";
            this.btnSendToBack.Size = new System.Drawing.Size(70, 21);
            this.btnSendToBack.TabIndex = 1;
            this.btnSendToBack.Text = "Send To Back";
            this.btnSendToBack.UseVisualStyleBackColor = true;
            // 
            // ImagesAndShapes
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "ImagesAndShapes";
            this.Size = new System.Drawing.Size(635, 538);
            this.pnlMain.ResumeLayout(false);
            this.pnlControls.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread_Sheet1)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericThickness)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericScale)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericRotate)).EndInit();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private FarPoint.Win.Spread.FpSpread fpSpread;
        private FarPoint.Win.Spread.SheetView fpSpread_Sheet1;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button btnPicture;
        private System.Windows.Forms.Button btnShape;
        private ShapePanel shapePanel1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.ComboBox comboDropShadow;
        private System.Windows.Forms.ComboBox comboOutlineStyle;
        private System.Windows.Forms.NumericUpDown numericThickness;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Button btnOutlineColor;
        private System.Windows.Forms.Button btnForeColor;
        private System.Windows.Forms.Button btnBackColor;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Button btnBringToFront;
        private System.Windows.Forms.Button btnSendToBack;
        private System.Windows.Forms.Button btnSetPicture;
        private System.Windows.Forms.CheckBox chkVerticalFlip;
        private System.Windows.Forms.CheckBox chkHorizontalFlip;
        private System.Windows.Forms.NumericUpDown numericScale;
        private System.Windows.Forms.NumericUpDown numericRotate;
        private System.Windows.Forms.CheckBox chkScale;
        private System.Windows.Forms.CheckBox chkRotate;
    }
}
